import { createApp } from 'vue'
import App from './App.vue'
import NutUI from "@nutui/nutui";
import "@nutui/nutui/dist/style.css";
import router from './router'
import store from './store'

import { showToast } from "@nutui/nutui";
import { showDialog } from "@nutui/nutui";

import userUtils from "@/utils/userUtils"
import arrayUtils from "@/utils/arrayUtils"
import areaUtils from "@/utils/areaUtils"
import cartUtils from "@/utils/cartUtils"

import Header from "@/components/Header"
import OrderItem from "@/components/OrderItem"

import authApi from "@/api/authApi";
import productApi from "@/api/productApi";
import orderApi from "@/api/orderApi";
import memberApi from "@/api/memberApi";
import thirdApi from "@/api/thirdApi";
import cartApi from "@/api/cartApi";
import searchApi from "@/api/searchApi";

const app = createApp(App);
app.config.globalProperties.$showToast = showToast
app.config.globalProperties.$showDialog = showDialog

app.config.globalProperties.$userUtils = userUtils
app.config.globalProperties.$arrayUtils = arrayUtils
app.config.globalProperties.$areaUtils = areaUtils
app.config.globalProperties.$cartUtils = cartUtils

app.config.globalProperties.$authApi = authApi
app.config.globalProperties.$productApi = productApi
app.config.globalProperties.$orderApi = orderApi
app.config.globalProperties.$memberApi = memberApi
app.config.globalProperties.$thirdApi = thirdApi
app.config.globalProperties.$cartApi = cartApi
app.config.globalProperties.$searchApi = searchApi

app.component("Header", Header);
app.component("OrderItem", OrderItem);

app.use(store).use(router).use(NutUI).mount('#app')
